package controllers

import (
	"github.com/astaxie/beego"
	"jujiu/biz/dts"
	"log"
)

type SynDataController struct {
	beego.Controller
}

func (this *SynDataController) Real2dev() {
	deviceId, e := this.GetInt64("deviceId")
	if e != nil {
		log.Println("获取参数错误！")
		return
	}
	_, desc := dts.Syn2OrtherDatasource(deviceId, "cn_real", "cn_dev")
	this.Ctx.WriteString(desc)
	return
}

func (this *SynDataController) Hangzhou2Frankfurt() {
	deviceId, e := this.GetInt64("deviceId")
	if e != nil {
		log.Println("获取参数错误！")
		return
	}
	_, desc := dts.Syn2OrtherDatasource(deviceId, "cn_real", "eu_real")
	this.Ctx.WriteString(desc)
	return
}
